package com.uex.dev.manage.admin.vo.project;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.uex.dev.manage.admin.po.ProjectFilesPO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.time.LocalDateTime;

/**
 * @author lzs
 * @create 2024/03/04
 * @description
 */
@Schema(description = "查看项目文档响应参数")
@Data
public class ProjectFileResp {
    @Schema(description = "文件Id")
    private Integer id;
    @Schema(description = "文件名称")
    private String fileName;
    @Schema(description = "文件地址")
    private String fileUrl;
    @Schema(description = "文件上传人")
    private String fileUser;
    @Schema(description = "文件上传时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime fileTime;

    public static ProjectFileResp fromPO(ProjectFilesPO projectFilesPO) {
        ProjectFileResp projectFileResp = new ProjectFileResp();
        BeanUtils.copyProperties(projectFilesPO, projectFileResp);
        return projectFileResp;
    }
}

